package app.services.impl;

import java.util.List;

import app.models.Paciente;
import app.repositories.PacienteRepository;
import app.repositories.Repository;
import app.services.PacienteService;
import br.com.caelum.vraptor.ioc.Component;

@Component
public class PacienteServiceImpl extends GenericServiceImpl<Paciente, Long> implements PacienteService {

	private final PacienteRepository repository;
	
	public PacienteServiceImpl (PacienteRepository repository){
		this.repository = repository;
		super.setGenericRepository((Repository<Paciente, Long>) repository);
	}
	
	public Paciente find(Long id) {
		return repository.find(id);
	}
	
	public List<Paciente> findPacientesByNameOrCpf(String cpf,String nome){
		return repository.findByNameOrCpf(cpf, nome);
	}
	
	public List<Paciente> findPacientesByFilter(String filter) {
		return repository.findByFilter(filter);
	}
	
	public List<Paciente> findLastPacientes(){
		return repository.findLastPacientes();
	}
	
	public List<Paciente> findAllOrdered(){
		return repository.findAllOrdered();
	}
	
	public List<Paciente> findAllOrderedWithoutMax(){
		return repository.findAllOrderedWithoutMax();
	}
	
	public List<Paciente> findNextBirthdays() {
		return repository.findNextBirthdays();
	}

	public Paciente findByUserId(Long userId) {
		return repository.findByUserId(userId);
	}
	
	public List<String> findAllNomes() {
		return repository.findAllNomes();
	}
	
}
